home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Pascal / Applications / ircle 1.5.1 / source / ircle sources / IRCInit.p < prev    next >
Encoding:
Text File  |  1993-11-15  |  2.7 KB  |  103 lines  |  [TEXT/PJMM]

  1. {    ircle - Internet Relay Chat client    }
  2. {    File: IRCInit    }
  3. {    Copyright © 1992 Olaf Titz (s_titz@ira.uka.de)    }
  4.  
  5. {    This program is free software; you can redistribute it and/or modify    }
  6. {    it under the terms of the GNU General Public License as published by    }
  7. {    the Free Software Foundation; either version 2 of the License, or    }
  8. {    (at your option) any later version.    }
  9.  
  10. {    This program is distributed in the hope that it will be useful,    }
  11. {    but WITHOUT ANY WARRANTY; without even the implied warranty of    }
  12. {    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    }
  13. {    GNU General Public License for more details.    }
  14.  
  15. {    You should have received a copy of the GNU General Public License    }
  16. {    along with this program; if not, write to the Free Software    }
  17. {    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    }
  18.  
  19. unit IRCInit;
  20. { Startup code. }
  21.  
  22. interface
  23. uses
  24.     TCPTypes, TCPStuff, TCPConnections, Coroutines, ApplBase, {}
  25.     MiscGlue, MsgWindows, InputLine, {}
  26.     IRCGlobals, IRCaux, IRCPreferences, IRCInput, {}
  27.     IRCNotify, IRCIgnore, DCC, IRCCommands, IRCChannels, IRCSComm, IRCHelp;
  28.  
  29. function IRCInitAll: boolean;
  30. { This will call ALL module startups and init ALL global variables. }
  31. { Returns false if program cannot be run. }
  32.  
  33. implementation
  34.  
  35. { Putting this module of 400+ bytes of code into an extra segment }
  36. { is a typical instance of memory management paranoia :-) }
  37.  
  38. function IRCInitAll: boolean;
  39.     var
  40.         i: integer;
  41.         s: str255;
  42.         b: boolean;
  43.         m: MenuHandle;
  44.     begin
  45.         i := InitConnections;
  46.         if i <> noErr then begin
  47.             NumToString(i, s);
  48.             ParamText(s, '', '', '');
  49.             i := Alert(A_TCPERR, nil);
  50.             IRCInitAll := false
  51.         end
  52.         else begin
  53.             InitCoroutines;
  54.             ApplInit;
  55.             WNETime := 1;
  56.             InitMsgWindows;
  57.             InitInputLine;
  58.             InitIRCPreferences;
  59.             InitDCC;
  60.             InitIRCChannels;
  61.             InitIRCInput;
  62.             InitIRCHelp;
  63.             InitIRCNotify;
  64.             InitIRCIgnore;
  65.             ISOEncode := TableHndl(GetResource('Tabl', 256));
  66.             ISODecode := TableHndl(GetResource('Tabl', 257));
  67.             CmdChar := '/';
  68.             CurrentServer := '';
  69.             CurrentTarget := '';
  70.             lastInvite := '';
  71.             lastMSG := '';
  72.             currentNick := '';
  73.             flushing := false;
  74.             logging := false;
  75.             readTimeout := 10;
  76.             GetDateTime(idleTime);
  77.             UserRegistered := false;
  78.             QuitRequest := false;
  79.             IsAway := false;
  80.             inBackground := false;
  81.             notified := false;
  82.             lastWindow := nil;
  83.             NFT := 0;
  84.             Watch := GetCursor(WatchCursor);
  85.             showJOIN := true;
  86.             showPART := true;
  87.             showQUIT := true;
  88.             showWALLOPS := true;
  89.             showTOPIC := true;
  90.             showINVITE := true;
  91.             showNICK := true;
  92.             showMODE := true;
  93.             showKICK := true;
  94.             showNAMES := true;
  95.             IRCInitAll := true;
  96.             m := GetMHandle(M_FONT);
  97.             AddResMenu(m, 'FONT');
  98.             AdjustFontMenu;
  99.             DrawMenuBar;
  100.         end;
  101.     end;
  102.  
  103. end.